
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="shortcut icon" href="ico/logo.ico" type="image/x-icon" />
    <title>协同办公系统--注册</title>
    <link rel="stylesheet" href="../static/css/bootstrap.css">
    <link rel="stylesheet" href="../static/js/layui/css/layui.css">
    <link rel="stylesheet" href="../static/css/font.css">

    <style>
        body{
            height: 100%;
            background-image:url("../static/imaegs/011.png");
            margin: auto;
        }

        #boxes>div{
            margin-left: 5%;
        }
        #left>a{
            margin-top:30px;
            margin-left: 20px;
            cursor: pointer;
        }
        #logo{
            margin-top: 20px;
            margin-left: 10%;
            height: 80px;
            display: flex;
            flex-direction: row;

        }
        #tiao{
            width: 100%;
            height: 50px;
            background-image: url("../static/imaegs/breadbg.gif");
            display: flex;
            flex-direction: row;
        }
        @media screen {

        }
        #right{
            margin-top: 10px;
            margin-left: 300px;

        }
        #from_block{
            width: 40%;
            margin-left: 10%;
            margin-top: 20px;
            height: 300px;
            padding-top: 20px;

        }
        #left{
            margin-left: 10%;
            margin-top: 10px;
        }
        #box{
            display: flex;
            flex-direction: row;
        }
        #from-right{
            margin-top: 20px;
            height: 100px;
            padding-top: 20px;
        }

        #footer{
            width: 100%;
            height: 100px;
            position: fixed;
            bottom: 0;
            text-align: center;

        }
        #fot-word{
            font-size: 9px;
            color: grey;
        }
        #hua1{
            width: 150px;
            position: absolute;
            float: left;
            bottom: 0;
        }    </style>
</head>
<body>
<div id="logo"><div id="logo-img"><img src="../static/imaegs/logo/logo2.png"></div></div>
<div id="tiao">
    <div id="left"><a href="http://jishubu.xyz"><i class="layui-icon" style="font-size: 20px; color: #1E9FFF;">&#xe68e;</i>&nbsp;首页</a><a href="login.html"><i class="layui-icon" style="font-size: 20px; color: #1E9FFF;">&#xe770;</i>&nbsp;登录页面</a></div>
    <div id="right"><a style="color:grey">有账号?&nbsp;</a><a href="login.html">立即登陆</a></div>
</div>
<div id="box">
<div id="from_block">
    <form method="post" >
        <div class="layui-form-item">
            <label class="layui-form-label login-form"><i class="iconfont" style="color: #0b3b8c">&#xe6b8;</i></label>
            <div class="layui-input-inline login-inline">
                <input type="text" name="username" id="username" lay-verify="required" placeholder="请输入你的帐号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label login-form"><i class="iconfont" style="color: #0b3b8c">&#xe82b;</i></label>
            <div class="layui-input-inline login-inline">
                <input type="password" name="password" id="password"  lay-verify="required" placeholder="请输入你的密码" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label login-form"><i class="iconfont" style="color: #0b3b8c">&#xe82b;</i></label>
            <div class="layui-input-inline login-inline">
                <input type="password" name="chack_psd" id="chack_psd"  lay-verify="required" placeholder="请再次输入你的密码" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label login-form"><i class="iconfont" style="color: #0b3b8c">&#xe82b;</i></label>
            <div class="layui-input-inline login-inline">
                <input type="password" name="code" id="code"  lay-verify="required" placeholder="邀请码" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="form-actions">
            <button class="btn btn-warning " lay-submit lay-filter="login" style="margin-left: 10%" onclick="login()" type="button">注&nbsp;&nbsp;册</button>
        </div>
    </form>
</div>
<hr>

<div id="from-right">
    <div class="layui-tab-item layui-show">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">温馨提示：</div>
                    <div class="layui-card-body">
                        如果你没有邀请码。可通过联系站长购买邀请码。谢谢<hr>
                        有邀请码可凭邀请码自己注册账号哦，邀请码由购得知
                    </div>
                </div>
            </div>

        </div>
    </div>

</div>
</div>
<img id="hua1" src="../static/imaegs/hau.png">
<div id="footer">
    <hr>
    <a id="fot-word">
        版权信息：xianghai保留所有权利，请尊重他人的劳动成果   ||    备案号：蜀ICP备18021117号
        ||           地址：四川省成都市高新区天一街83号软件大楼
    </a>
</div>
<script src="../static/js/jquery.min.js"></script>
<script src="../static/js/layui/layui.all.js"></script>
<script>


    function login() {
        var user_name = $('input[name="username"]'),
            user_pwd = $('input[name="password"]'),
            chack = $('input[name="chack_psd"]'),
            code=$('input[name="code"]');
        if (user_name.val() === '') {
            layer.msg('你的账号还未填写');
            return false;


        }
        if (user_pwd.val() === '') {
            layer.msg('你的密码还未填写');
            return false;
        }

        else if (chack.val() !== user_pwd.val()) {
            layer.msg("您两次输入的密码不一致，请重新输入");
            return false;

        }
        else if(code.val()===''){
            layer.msg("对不起，你还没有填写邀请码哦！");
            return false;
        }

        else {
            $user = user_name.val();
            $pass = user_pwd.val();
            $code=code.val();
            $.ajax({
                type: 'post',
                cache: 'false',
                url: '../php/admin/add_admin.php',
                data: {
                    "user": $user,
                    "pass": $pass,
                    "code":$code,
                },
                dataType: 'Json',
                success: function (dat) {
                    layer.msg(dat.message);



                },
                error: function (dat) {
                    layer.msg("登陆失败，请检查网络是否正常");
                }


            })


        }
    }


</script>
</body>
</html>